package gw.common.tool;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Hashtable;

import gw.spider.spider001.HttpRequest;
import gw.spider.spider001.HttpResponse;

public class tools {
	public static String ReadStringFromUrl(String url)
	{
		HttpRequest req = HttpRequest.get(url);
		HttpResponse res = req.send();		
		String body = res.body();
		return body;
	}
	public void AddToHashMap(Hashtable<String, Integer> hashtable,ArrayList<String> arrayList)
	{
		if (arrayList != null && !arrayList.isEmpty() && hashtable!=null && !hashtable.isEmpty()) {
			for (String string : arrayList) {
				if (!hashtable.containsKey(string)) {
					hashtable.put(string, 0);
				}
			}
		}
	}
}
